package mrHunter;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

public class UserInf {
    @NotNull
    @Size(min=2, max=16)
    private String username;

    @NotNull
    @Size(min=5, max=25)
    private String password;

    @NotNull
    @Email
    private String email;

    //0:not pass  1:pass
    private int passTutorial;

    private int[] currentLevel;

    public UserInf(){
        currentLevel=new int[4];
        for(int i=0;i<4;i++)
            currentLevel[i]=1;
    }

    public UserInf(String username,String password,String email,int passTutorial, String currentLevel){
        this.username=username;
        this.password=password;
        this.email=email;
        this.passTutorial=passTutorial;
        String[] levels=currentLevel.split(",");
        this.currentLevel=new int[levels.length];
        for(int i=0;i<levels.length;i++){
            this.currentLevel[i]=Integer.parseInt(levels[i]);
        }
    }

    public String getUsername(){return username;}

    public void setUsername(String username){this.username=username;}

    public String getPassword(){return password;}

    public void setPassword(String password){this.password=password;}

    public String getEmail(){return email;}

    public void setEmail(String email){this.email=email;}

    public void setPassTutorial(int passTutorial) {
        this.passTutorial=passTutorial;
    }

    public int getPassTutorial() {
        return passTutorial;
    }

    public int[] getCurrentLevel() {
        return currentLevel;
    }

    public void setCurrentLevel(int[] currentLevel) {
        this.currentLevel = currentLevel;
    }
}
